
local template = require("resty.template")
local mysql = require("lib.mysql")
local db = mysql:new()

local res, err, errno, sqlstate = db:query('select url,count, request_body_byte from ( select url,count(*) count,sum(request_body_byte) request_body_byte from     log_record  where access_time>NOW()-INTERVAL 2 HOUR group by url ) as logRecord order by request_body_byte desc ')
db:close()
if not res then
  ngx.log(ngx.ERR,"select error: ", err, ": ", errcode, ": ", sqlstate, ".")
  res={}
end
local context = {
  logList=res,

}

template.render("logListReport.html", context)